<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="gly"%>
<html>
<head>
<meta charset="GB18030">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="stylesheet"
	href="${pageContext.request.contextPath}/static/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/static/css/font-awesome.min.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/static/css/main.css">
</head>
<body style="margin-top: -50px">
	<ol class="breadcrumb">
		<li><a
			href="${pageContext.request.contextPath}/repairs/getByCondition">送修信息登记</a></li>
		<li class="active">修改</li>
	</ol>
	<div class="panel panel-default" style="width: 800px;">
		<div class="panel-heading">
			表单数据
			<div style="float: right; cursor: pointer;" data-toggle="modal"
				data-target="#myModal">
				<i class="glyphicon glyphicon-question-sign"></i>
			</div>
		</div>
		<div class="panel-body">
			<form action="${pageContext.request.contextPath}/repairs/doUpdate"
				method="post">
				<div class="form-group" hidden="true">
					 <input
						type="text"  class="form-control"
						name="rpId" value="${repairs.rpId}">
				</div>
				<div class="form-group">
					<label for="exampleInputdriverName">车牌号码</label> 
					 <input
						type="text" readonly="readonly" class="form-control"
						name="rpCarlicense" value="${repairs.rpCarlicense}">
				</div>
				<div class="form-group">
					<label for="exampleInputdriverDept">修理厂</label>
					 <input
						type="text" readonly="readonly" class="form-control"
						name="rpUnit" value="${repairs.rpUnit}">
				</div>
				<div class="form-group">
					<label for="exampleInputdrivingtype">维修类别</label> <select
						id="exampleInputdrivingtype" class="form-control"
						name="rpType">
						<gly:forEach items="${typeList}" var="type">
							<option value="${type}">${type}</option>
						</gly:forEach>
					</select>
				</div>
				<div class="form-group">
					<label for="exampleInputdriverEntrytime">送修时间</label> 
					<input
						type="date" class="form-control" id="exampleInputdriverEntrytime" readonly="readonly" 
						value="${repairs.rpSendtime}" >
				</div>
				<div class="form-group">
					<label for="exampleInputdriverBirthday">取车时间</label> <input
						type="date" class="form-control" id="exampleInputdriverBirthday"
						name="rpGettime" value="${repairs.rpGettime}" >
				</div>
				<div class="form-group">
					<label for="exampleInputdriverBirthday">花费金额</label> <input
						type="text" class="form-control"
						name="rpAmount" required="required" value="${repairs.rpAmount}">
				</div>
				<div class="form-group">
					<label for="exampleInputdriverIdentity">维修项目</label> <input
						type="text" class="form-control" id="exampleInputdriverIdentity"
						name="rpProject" required="required" value="${driver.rpProject}">
				</div>
				<div class="form-group">
					<label for="exampleInputdriverIdentity">使用材料</label> <input
						type="text" class="form-control" id="exampleInputdriverIdentity"
						name="rpMaterials" required="required" value="${repairs.rpMaterials}">
				</div>
				<div class="form-group">
					<label for="exampleInputdriverIdentity">取车备注</label> <input
						type="text" class="form-control" id="exampleInputdriverIdentity"
						name="rpGetremark" required="required" value="${repairs.rpGetremark}">
				</div>
				<button type="submit" class="btn btn-success">
					<i class="glyphicon glyphicon-plus"></i> 修改
				</button>
				<button type="reset" class="btn btn-danger">
					<i class="glyphicon glyphicon-refresh"></i> 重置
				</button>
			</form>
		</div>
	</div>
	<script
		src="${pageContext.request.contextPath}/static/jquery/jquery-2.1.1.min.js"></script>
	<script
		src="${pageContext.request.contextPath}/static/bootstrap/js/bootstrap.min.js"></script>
	<script
		src="${pageContext.request.contextPath}/static/script/docs.min.js"></script>
	<script type="text/javascript">
		$(function(){
			addDate();
		})
		</script>
	<script type="text/javascript">
		function addDate(){
			var da=new Date().format("yyyy-MM-dd");
			$("#exampleInputdriverEntrytime").val(da);
			$("#exampleInputdriverBirthday").val(da);
		}
		
		Date.prototype.format = function(format){
		    var o = {
		        "M+" : this.getMonth()+1, //month
		        "d+" : this.getDate(), //day
		        "H+" : this.getHours(), //hour
		        "m+" : this.getMinutes(), //minute
		        "s+" : this.getSeconds(), //second
		        "q+" : Math.floor((this.getMonth()+3)/3), //quarter
		        "S" : this.getMilliseconds() //millisecond
		    }
		 
		    if(/(y+)/.test(format)) {
		        format = format.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length));
		    }
		 
		    for(var k in o) {
		        if(new RegExp("("+ k +")").test(format)) {
		            format = format.replace(RegExp.$1, RegExp.$1.length==1 ? o[k] : ("00"+ o[k]).substr((""+ o[k]).length));
		        }
		    }
		    return format;
		}
		</script>
</body>
</html>